home *** CD-ROM | disk | FTP | other *** search
- public _indexword
- ;∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
- ; Find a word (2bytes) in a counted list
- ; In:
- ; AX - word to find
- ; EDX -> string of words, first byte is length (in words)
- ; Out:
- ; CF=1 - not found
- ; CF=0 - found
- ; EAX - index
- ;∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
- _indexword:
- push edi
- push ecx
- lea edi,[edx+1]
- movzx ecx,byte ptr [edx]
- repnz scasw
- jnz short indexwordf0
- movzx eax,byte ptr [edx]
- sub eax,ecx
- dec eax
- jmp short indexwordf1
- indexwordf0:
- stc
- indexwordf1:
- pop ecx
- pop edi
- ret
-
-